package com.dangf.controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dangf.entity.Article;
import com.dangf.service.ArticleService;

/**
 * 文章控制器
 * @author HaiSheng
 * @date 2015年7月13日
 */

@Controller
@RequestMapping("/article")
public class ArticleController extends BaseController {
	
	@Resource
	private ArticleService articleService;
	
	@RequestMapping("")
	@ResponseBody		//列表
	public Map<String, Object> index(int start,int count) {
		if(count==0){
			return setResult(HTTP_CODE_FAILED, "请输入要查询的数量！", "");
		}else{
			List<Article> list = articleService.getListByPage(start, count);
			return setResult(HTTP_CODE_SUCCESS, "查询成功！", list);
		}
		
	}

}
